import React from 'react';
import { Outlet, useLocation } from 'react-router-dom';

import NativeTabBar from './components/NativeTabBar';
import './App.css';

const App: React.FC = () => {
  const location = useLocation();
  const { pathname } = location;

  // 如果是登录页面或会议页面，不显示标签栏
  const isLoginPage = pathname === '/login';
  const isMeetingPage =
    pathname.startsWith('/meeting') || pathname === '/MeetingRoom';

  // 如果是登录页或会议页，只渲染内容
  if (isLoginPage || isMeetingPage) {
    return <Outlet />;
  }

  return (
    <div className="app-container">
      <div className="app-content">
        <Outlet />
      </div>
      <NativeTabBar />
    </div>
  );
};

export default App;
